<%= form_for(@data_type,:html=>{:class=>"form-horizontal"}) do |f| %>
  <% if @data_type.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@data_type.errors.count, "error") %> prohibited this data_type from being saved:</h2>

      <ul>
      <% @data_type.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

<div class="form-group">
  <%= f.label "名 称",:class=>"col-sm-2 control-label" %>
  <div class="col-sm-4">
  <%= f.text_field :name, autofocus: true,:class=>"form-control",:placeholder=>"Enter name"%>
  </div>
</div>

<div class="form-group">
  <%= f.label "缩写",:class=>"col-sm-2 control-label" %>
  <div class="col-sm-4">
  <%= f.text_field :code, autofocus: true,:class=>"form-control",:placeholder=>"Enter code"%>
  </div>
</div>

<div class="form-group">
  <%= f.label "信息分组",:class=>"col-sm-2 control-label" %>
  <div class="col-sm-4">
  <%= f.select :group_name,DataType.get_groups %>
  </div>
</div>

<div class="form-group">
  <%= f.label "序号",:class=>"col-sm-2 control-label" %>
  <div class="col-sm-4">
  <%= f.text_field :no, autofocus: true,:class=>"form-control",:placeholder=>"Enter code"%>
  </div>
</div>

<div class="form-group">
  <%= f.label "上级分类",:class=>"col-sm-2 control-label" %>
  <div class="col-sm-4">
  <%= f.select :sup_id, @sups.collect{|p| [ p.name, p.id ] },include_blank: true%>
  </div>
</div>


<div class="form-group">
  <div class="col-sm-offset-2 col-sm-10">
    <button type="submit" class="btn btn-default btn-primary">提 交</button>
  </div>
</div>


<% end %>
